package com.xy.tool.gid.dao;

import com.xy.tool.gid.domain.GidNode;

import java.util.Collection;
import java.util.List;

/**
 * Created by zsp on 2018/7/11.
 */
public interface GidNodeDao {

    /**
     *
     * @param collection
     * @return
     */
    int saveAllNode(Collection<GidNode> collection);

    /**
     *
     * @param sequence
     * @param ip
     * @param port
     * @return
     */
    int updateEmptyNode(Integer sequence, String ip, Integer port);

    /**
     * 根据ip, 端口获取服务实例的顺序号
     *
     * @param ip
     * @param port
     * @return
     */
    Integer getSequenceByIpAndPort(String ip, Integer port);

    /**
     *
     * @param size
     * @return
     */
    List<GidNode> listEmptyNode(int size);

    /**
     *
     * @return
     */
    int countNode();

}
